package com.example.blog_001.Mapper;


import com.example.blog_001.Entity.Blog;
import com.example.blog_001.Vo.*;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface BlogMapper {
    List<BlogQuery> listBlogs();
    // blog 最基本的增删改查
    int selectblog(Integer id);
    int saveBlog(Blog blog);
    int updateblog(Blog blog);
    int deleteblog(Integer id);
    // showblog
    int updateBlog(ShowBlog showBlog);
    int getBlogByid(ShowBlog showBlog);
    //searchblog
    List<SearchBlog> searchblogs(SearchBlog searchBlog);

    //前端博客首页查询
    List<FirstPageBlog> getFirstPageBlogs();
    //前端最新博客查询
    List<RecommendBlog> recommendedBlogs();

    List<FirstPageBlog> getSearchBlogs(String query);

    DetailedBlog getDetailedBlogById(Long id);

    void updateViews(Long id);

    void getCommentCountById(Long id);

    Integer getBlogTotal();

    Integer getBlogViewTotal();

    Integer getBlogCommentTotal();

    Integer getBlogMessageTotal();

    List<FirstPageBlog> getBlogsByTypeId(Long id);

    List<ArchiveBlog> getArchiveBlogs();

    ShowBlog getBlogById(Long id);

    int deleteBlogById(Long id);

    List<SearchBlog> searchBlogs(SearchBlog searchBlog);
}
